import React from 'react';
import ReactDOM from 'react-dom';
import mirror, {actions, connect,Link} from 'mirrorx';
import { Modal } from 'antd-mobile';


const goodId = T.urlQuery("goodId");
const packageId = T.urlQuery("packageId");
const planId = T.urlQuery("planId"); 
const campaignId = T.urlQuery("campaignId"); 

class App extends React.Component { 
	constructor(props) {
		super(props); 
        this.state={
            modal1:false
        };       
	}

    componentDidMount(){        
		
    }
    
    showModal = key => (e) => {
        e.preventDefault(); // 修复 Android 上点击穿透
        this.setState({
        [key]: true,
        });
    }
    onClose = key => () => {
        this.setState({
        [key]: false,
        });
    }

    
    render() {
        const notice = sessionStorage.getItem("notice");
        return(<div className="notice" style={{paddingBottom:"1.2rem"}}>
        <Modal
          visible={this.state.modal1}
          transparent
          maskClosable={false}
          onClose={this.onClose('modal1')}
          title="提示"
          footer={[{ text: 'ok', onPress: () => { this.onClose('modal1')(); } }]}
          wrapProps={{ onTouchStart: this.onWrapTouchStart }}
        >
            <div>
                <p>您选择的告知不符合要求，请重新选择！</p>
            </div>
        </Modal>
        <div className="content">
        <p className="f30 strong pl20 pt20">告知</p>
        <div dangerouslySetInnerHTML={{__html: notice}} />
        
        </div> 
               
        <div className="footer">       
            <table>
                <tbody>
                    <tr>
                        <td className="bor-right"  style={{width:"50%"}}>
                            <a href={"insure?goodId="+goodId+"&packageId="+packageId+"&planId="+planId+"&campaignId="+campaignId} className="f32  tac fcw diy_background" >YES</a>
                        </td>
                        
                        <td style={{width:"50%"}}>
                            <a  href="javascript:;"  className="f32 tac fcw diy_background" onClick={this.showModal('modal1')}>NO</a>
                        </td> 
                    </tr>
                </tbody>
            </table>            
     </div>   
			
        </div>)
    }
}

export default App;